home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d953.lha / ISAM / ISAM.doc < prev    next >
Text File  |  1993-11-28  |  53KB  |  1,106 lines

  1.  
  2.                   ===========================================
  3.                   = ISAM -  for the Commodore (R) Amiga (R) =
  4.                   ===========================================
  5.  
  6.                             ----------------------
  7.                             | Version : 1.03     |
  8.                             | Released: 11/28/93 |
  9.                             ----------------------
  10.  
  11. ISAM Copyright (C) 1992, 1993 Scott C. Jacobs / RedShift Software.
  12. All Rights Reserved. GTDR.
  13.  
  14.  
  15.  
  16. ===============================================================================
  17. ===============================================================================
  18. ==                                                                           ==
  19. ==                        PROGRAM LICENSE AGREEMENT                          ==
  20. ==                                                                           ==
  21. ==   REDSHIFT SOFTWARE DISCLAIMS ALL WARRANTIES RELATING TO THIS SOFTWARE,   ==
  22. ==   WHETHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED    ==
  23. ==   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE,     ==
  24. ==   AND ALL SUCH WARRANTIES ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED.      ==
  25. ==   NEITHER REDSHIFT SOFTWARE NOR ANYONE ELSE WHO HAS BEEN INVOLVED IN      ==
  26. ==   THE CREATION, PRODUCTION OR DELIVERY OF THIS SOFTWARE SHALL BE LIABLE   ==
  27. ==   FOR ANY INDIRECT, CONSEQUENTIAL, OR INCIDENTAL DAMAGES ARISING OUT OF   ==
  28. ==   THE USE OR INABILITY TO USE SUCH SOFTWARE EVEN IF REDSHIFT SOFTWARE     ==
  29. ==   HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS.  IN NO   ==
  30. ==   EVENT SHALL REDSHIFT SOFTWARE'S LIABILITY FOR ANY DAMAGES EVER EXCEED   ==
  31. ==   THE PRICE PAID FOR THE LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE   ==
  32. ==   FORM OF CLAIM.  THE PERSON USING THE SOFTWARE BEARS ALL RISK AS TO THE  ==
  33. ==   QUALITY AND PERFORMANCE OF THE SOFTWARE.                                ==
  34. ==      Some states do not allow the exclusion of the limit of liability     ==
  35. ==   for consequential or incidental damages, so the above limitation may    ==
  36. ==   not apply to you.                                                       ==
  37. ==      This agreement shall be governed by the laws of the United States    ==
  38. ==   of America, State of New York and shall inure to the benefit of         ==
  39. ==   RedShift Software and any successors, administrators, heirs and         ==
  40. ==   assigns.  Any action or proceeding brought by either party against      ==
  41. ==   the other arising out of or related to this agreement shall be brought  ==
  42. ==   only in a STATE or FEDERAL COURT of competent jurisdiction located in   ==
  43. ==   Monroe County, New York.                                                ==
  44. ==   The parties hereby consent to in personam jurisdiction of said courts.  ==
  45. ==                                                                           ==
  46. ==                                                                           ==
  47. ==    This software and the disk(s) on which it is contained is licensed     ==
  48. ==    to you, for your own use.  This is copyrighted software.  You are      ==
  49. ==    not obtaining title to the software or any copyright rights.  You      ==
  50. ==    may not sublicense, rent, lease, convey, modify, translate, convert    ==
  51. ==    to another programming language, decompile, or disassemble the         ==
  52. ==    software for any purpose.                                              ==
  53. ==                                                                           == 
  54. ==    You may make as any copies of this software as you need for back-up    ==
  55. ==    purposes.  You may use this software on more than one computer,        ==
  56. ==    provided that there is no chance it will be used simultaneously on     ==
  57. ==    more than one computer.  If you need to use the software on more       ==
  58. ==    than one computer simultaneously, please contact us for information    ==
  59. ==    about site licenses.                                                   ==
  60. ==                                                                           ==
  61. ==                                                                           ==
  62. ==    REGISTERED VERSIONS of this software may NOT be copied (except as      ==
  63. ==    described above for backup), and may NOT be distributed.               ==
  64. ==                                                                           ==
  65. ==    Individuals may freely copy any SHAREWARE VERSION of the software and  ==
  66. ==    share it with friends and family.                                      ==
  67. ==    Nonprofit groups (including user groups and BBSs) may distribute       ==
  68. ==    copies of the SHAREWARE VERSION.  A fee of not more than US$ 5.00      ==
  69. ==    may be charged to cover disk copying costs.  If the files in a         ==
  70. ==    SHAREWARE VERSION have dates more than a year old, we request that you ==
  71. ==    contact us for a free upgrade to the current SHAREWARE VERSION.        ==
  72. ==    Disk distributors and dealers must have written permission before      ==
  73. ==    selling copies of the SHAREWARE VERSION of this software.  When you    ==
  74. ==    contact us, you will receive a free copy of the latest SHAREWARE       ==
  75. ==    VERSION and you will be placed on our mailing list to receive updates  ==
  76. ==    as they are released.                                                  ==
  77. ==    Disk distributors may charge no more than US$ 10.00 per disk for       ==
  78. ==    copies of this software.  If, as a distributor, you supply copies to   ==
  79. ==    other resellers, the end price to the user may not exceed US$ 10.00.   ==
  80. ==                                                                           ==
  81. ==    Anyone distributing copies of the SHAREWARE VERSION of this software,  ==
  82. ==    whether for profit or as a nonprofit organization, must conform to     ==
  83. ==    the following:                                                         ==
  84. ==       The files [on each disk] may not be modified or adapted in any way. ==
  85. ==       All of the files provided [on the disk] must be distributed         ==
  86. ==       together.                                                           ==
  87. ==       Individual files or groups of files may not be sold separately.     ==
  88. ==       Additional files may be added and this software may be combined on  ==
  89. ==       a disk with other programs.                                         ==
  90. ==       This software may not be represented as anything other than share-  ==
  91. ==       ware, and the shareware concept must be explained in any ad or      ==
  92. ==       catalog that includes this software and on any packaging used to    ==
  93. ==       display the disk.                                                   ==
  94. ==       You must immediatly stop selling/distributing copies of this disk   ==
  95. ==       upon notice from the author or RedShift Software.                   ==
  96. ==                                                                           ==
  97. ===============================================================================
  98. ===============================================================================
  99.  
  100.  
  101.                              ISAM FEATURES/LIMITS
  102.                              --------------------
  103.  
  104. Multiple Keys
  105. Unique/Repeatable Keys
  106. Multi-"user"
  107. Client/Server Design
  108. Fixed-length Records
  109. File/Record Locking (Exclusive/Shared)
  110. Deleted-record-space reclaimed
  111. Minimal code size used per program
  112. Small server size
  113. Resident Library of functions
  114.  
  115. Max. Users             : 4,294,967,296       ( largest unsigned long + 1 )
  116. Max. Open ISAM Files   : 2,147,483,648       ( largest unsigned long / 2 )
  117.  
  118. Max. Number of Keys    :        65,536/file  ( largest unsigned word + 1 )
  119. Max. Key Length        :           499 Bytes ( Keynode Size - 13 )
  120. Min. Key Length        :             1 Byte
  121.  
  122. Max. Number of Records : 4,294,967,296/file  ( largest unsigned long + 1 )
  123. Max. Record Length     : 4,294,967,296 Bytes ( largest unsigned long + 1 )
  124. Min. Record Length     :             4 Bytes ( used in deleted-record-space
  125.                                                reclamation )
  126.  
  127. The above maximum figures are of course limited by available disk space
  128. and/or available memory (and CPU horsepower).
  129. If there is an upper limit on the size of a file, then the above maximum
  130. Record Count/Length figures may, of course, be smaller.
  131.  
  132.  
  133.  
  134. REQUIREMENTS:
  135.   Any Amiga, AmigaDOS (R) V1.2 or higher.
  136.   Any Language that can access Resident Libraries (such as the Amiga system
  137. libraries (Exec/Intuition/DOS/etc)).
  138.   Closest fit: users of Lattice (R) C or SAS/C (R).
  139.  
  140.  
  141.  
  142.  
  143.                                     ====
  144.                                     ISAM
  145.                                     ====
  146.  
  147. WHAT IT IS:
  148.  
  149.   ISAM - Indexed Sequential Access Method - is a method of storing records,
  150. for retrieval in any pre-selected order.  As its name implies, records
  151. are usually stored sequentially in the DATA File, in the order in which they
  152. are received.  A separate file, the INDEX File, is used to store the indices
  153. (usually referred to as "keys") that order the records.  
  154. Together, the data and index files are referred to as an ISAM FILE.
  155.  
  156. A RECORD is a group of related information, stored together.  Each piece
  157. of information is called a FIELD of the record.  For example: an "Employee"
  158. record in a business might have a field for First Name, a field for Last Name,
  159. one for Phone Number, Address, Annual Salary, Social Security Number, etc.
  160. For all records in a file, the same field is in the same position in each
  161. record.
  162.  
  163. KEYS are special areas of a record that hold information by which the records 
  164. will be ordered (kept sorted).  A key is often a single field.
  165. For example: in the above "Employee" record, a likely key would be the 
  166. employee's Last Name field; another key might be the Social Security Number.
  167. The employee's First Name, while an important piece of information, would
  168. probably not be made a key.
  169. Keys do not have to correspond to single fields.  If our "Employee" had
  170. the Last Name stored before the First Name, a key could span both the Last
  171. Name and the First Name fields.  All employees would be ordered as before,
  172. but all those with identical Last Names would themselves be ordered by
  173. First Names.  Also, to save space, a key might consist of just a part of a
  174. field.  If the Last Name field were 30 characters long, a key might be just
  175. 10 bytes long, the first 10 characters of the Last Name.
  176.  
  177. An ITERATION is a sequence of records retrieved in key order.  An iteration
  178. may consist of all of the records in the file, or it may be limited to 
  179. records having keys of one key value; it may consist of a RANGE of records
  180. from one key value to another, or all records whose keys begin with a certain
  181. PREFIX.
  182.  
  183. As implemented, this version of ISAM consists of two main parts: a SERVER and
  184. a RESIDENT (SHARED) LIBRARY.  The server is a background program that does the
  185. actual work of storing/retrieving records.  All programs that need to store/
  186. retrieve records are separate from the server, and contain only references to
  187. the functions called in the library.  The library is small and only contains
  188. enough code to allow communication with the server.
  189. This means that programs using ISAM are no larger than the program object
  190. code itself (not counting, of course, code linked from other libraries). 
  191. The ISAM library is only about 7.5K.
  192. The server occupies 54K, plus a 4K stack, plus dynamically-allocated memory
  193. for each task, file, key, iteration, etc.
  194.  
  195. Multiple programs or tasks (hereafter referred to as "users") may use ISAM
  196. concurrently, and more than one user may have the same ISAM file open at the
  197. same time.
  198. Of course, only one user will have ISAM's attention at any one instant.
  199. Requests that arrive while ISAM is busy will be serviced one at a time,
  200. in the order that they arrive.  Most functions return almost instantan-
  201. eously.
  202.  
  203. Except for record size, and the location and size of each key, ISAM does not
  204. know or care what your record looks like.  All non-key areas of a record
  205. are ignored, and the records themselves are stored/retrieved unaltered.
  206.  
  207.  
  208.  
  209.  
  210.                                    KEYS
  211.                                    ----
  212.  
  213. This implementation of ISAM allows multiple indices (keys).  Each of these
  214. may be unique or repeatable.  A UNIQUE key only allows each possible key value
  215. to appear once in the file.  A REPEATABLE key allows a key value to appear
  216. more than once.  Each key may be ASCENDING (... ,57, 59, 67, 67, 108, ...) or
  217. DESCENDING ( ..., Zebra, Talon, Talon, Mussel, Cadillac, Abacus, ...).  
  218. A Key may have one of 5 types:  integer, floating point, single character, and
  219. two types of text: normal alphbetical order, where case is not significant
  220. ("Abacus" is equivilent to "abacus","aBaCuS","ABAcus", and so forth),
  221. and straight ascii, where case is significant.  Ascii is useful for non-text
  222. keys as well.
  223.  
  224. Each key has a location and a size.  The location is the byte offset from the
  225. beginning of the record.  A key beginning at the start of the record would 
  226. have an offset of zero.
  227.  
  228. Keys are referred to by number.  The first key listed in the Specs File (see
  229. below) is key 0, the next is key 1, and so on, up to key N-1 (if there are
  230. N keys).
  231.  
  232. Keys may overlap each other, partially or completely, and do not have to
  233. correspond to single fields in the record.  For instance, a key could span
  234. a date field and a name field for absent students.  If the key is ascending,
  235. all students absent on a particular day would be grouped together, and for
  236. that day would be grouped alphabetically (A-Z).  A second key could be just
  237. the date, in descending order, so as to order the students from the most
  238. recently absent back to those absent on the first day of school.
  239. NOTE: a key may have only ONE type.  A key that spans several fields of
  240. differing types will NOT act as if each part of the key is handled separately.
  241. An ascii type key that spans a floating point number will not order that part
  242. of the key in floating point order.
  243. Spanning multiple fields is generally only workable for text types (including
  244. single character), and unsigned integers or other groups of bytes which
  245. happen to be ordered left-to-right with the most significant byte on the left
  246. (like unsigned integers, if the above description confuses).
  247.  
  248. Keys cannot contain "holes", cannot contain non-consecutive pieces of a record.
  249.  
  250. Ex. if a record has the following fields in the order given:
  251.              ID SocialSecurityNumber LastName FirstName
  252.  
  253. there CAN be a key that spans ID and SocialSecurityNumber, but there CANNOT
  254. be a key that contains ID and LastName, without SocialSecurityNumber.
  255.  
  256. To get around this, one can either rearrange the record to place the fields
  257. necessary for the key next to each other, or if that is impossible because
  258. there is already a key involving one of the fields and a different field,
  259. then one can repeat a field in the record.
  260.  
  261. Ex.  if there is a key on ID/SocialSecurityNumber and a key is needed on
  262.      ID/LastName, then add another ID field to the record:
  263.  
  264.              ID SocialSecurityNumber ID LastName FirstName
  265.  
  266.  
  267.  
  268.  
  269.                                 SPECS FILE
  270.                                 ----------
  271.  
  272. In order for ISAM to be able to manipulate records in an ISAM file correctly,
  273. it must know certain information about the file, records and keys.  This
  274. information is stored in a separate specifications file (or SPECS FILE).
  275. One specs file must exist for each ISAM file, and contains the information for
  276. one type of record.
  277.  
  278. The specs file is an ascii file (use your favorite text editor) with 4 or
  279. more lines in it:
  280.  
  281.    Line #1 : the data  file path/name,  Ex: "work:finances/checks.data"
  282.          2 : the index file path/name,  Ex: "FINANCES:checks.index"
  283.          3 : the record size,           Ex: "126"
  284.          4 : one or more key specification lines (one line per key)
  285.  
  286.  
  287. FILE PATH/NAME
  288. --------------
  289.  
  290. No particular file extension is required for either file.  ".data" and
  291. ".index" are intuitive, but ".harry" and ".sally" would work just the same.
  292. In fact, no extension at all is required.  The above files could be 
  293. "work:finances/checks0" and FINANCES:checks1" if you like.
  294. It is permissible to have the data and index files (and Specs file) on 
  295. different devices.  Say: data file on one floppy, and the index on another;
  296.                          data file on floppy, the index in RAM: (temporarily,
  297.                          of course...), etc.
  298. It is suggested that logical devices be used for paths.  (In the above 
  299. examples, we assume that "FINANCES:" has been assigned "work:finances" if
  300. the user wished to keep both the data and index file in the same directory).
  301. If a logical device is used in the Specs file to designate the files' paths,
  302. then should it become desirable to move the file to another location (say,
  303. RAM:, to speed up a lengthy report), all you need to do is re-"Assign" the
  304. logical device, and no editing of the Specs file is needed.
  305. More importantly, if a logical device is used to specify the location of
  306. the Specs file itself in the program code, should it become necessary to
  307. move the Specs file, the program need not be re-compiled and re-linked.
  308.  
  309.  
  310. RECORD SIZE
  311. -----------
  312.  
  313. The record size must be at least 4 bytes.  The first four bytes of a deleted
  314. record are used to allow ISAM to locate it so its space may be reclaimed
  315. when a subsequent record is stored.
  316.  
  317. When figuring record sizes and key offsets (see below), remember that
  318. the system aligns certain data types on even byte boundaries, and thus
  319. record fields may be offset further in the record than expected, and
  320. the record itself may be larger as a result.
  321. C programmers should use the "sizeof()" function to be sure of the record
  322. size (see example below for Key Offset).
  323.  
  324.  
  325. KEY SPECIFICATION LINE
  326. ----------------------
  327.  
  328. Each key specification line consists of 5 items, each separated by one or
  329. more spaces:
  330.  
  331.   1 : the key offset
  332.   2 : the key length
  333.   3 : the key type
  334.   4 : whether the key is ascending or descending
  335.   5 : whether the key is unique or repeatable
  336.  
  337. Key Offset
  338. ----------
  339.   When figuring offsets, remember that integers, floats, doubles and pointers
  340. are aligned on even addresses, so if, for example, an integer appears to
  341. start at offset 3 (after a 3 character string, for example), it doesn't - it
  342. starts at offset 4.
  343.  
  344.   For C programmers, Lattice/SAS C 5.02 and later revisions contain the
  345. macro "offsetof()" in the header "stddef.h".  This produces record field
  346. offsets.  A small program contining this, along with sizeof() (for figuring
  347. record sizes) and your struct definition, should fairly painlessly determine
  348. the necessary information.
  349. (for those not possessing the above-mentioned file, it contains the following
  350. lines:
  351.  
  352.      -------------------------------------------------------------
  353.         typedef unsigned int size_t;
  354.  
  355.         #define offsetof(type,memb) (size_t)&(((type *)0L)->memb)
  356.      -------------------------------------------------------------
  357.  
  358. (where 'type' is the struct type name and 'memb' the struct field the offset  
  359. of which you're trying to find).
  360.  
  361. Example:  struct Employee {
  362.               int EmpNo;
  363.               char Name[31];
  364.               float Salary;
  365.               char SSNo [11]; /* incl. '-' */
  366.           };
  367.  
  368.           ...
  369.           printf ( "The offset of Salary in the Employee struct is %u.\n",
  370.                    offsetof ( struct Employee, Salary ) );
  371.  
  372.           printf ( "The size of Employee struct is: %d.\n", 
  373.                    sizeof ( struct Employee ) );
  374.           ...
  375. See the file "offsetof.c", and try it with one of your records.
  376.  
  377. Non-C programmers may have to figure record sizes and key offsets "by hand".
  378.  
  379.  
  380. Key Length
  381. ----------
  382.   An integer key can have three lengths:     1, 2, 4.
  383.   A floating point key can have two lengths: 4, 8.
  384.   A character key can have only one length:  1.
  385.   A text/ascii key can be any length (greater than zero)
  386.  
  387.     NOTE: ISAM will know from what is specified here how long the key is;
  388.           and will only store/retrieve that length: therefore, text keys
  389.           do NOT need an extra byte on the end to store a '\0' (you may,
  390.           of course, wish to have one there for other purposes), and there
  391.           is no point in including the '\0' byte in the key length, as this
  392.           would only result in wasted file space.
  393.  
  394. Key Type
  395. --------
  396.   There are 5 types, each specified by a single letter:
  397.      I - integer
  398.      F - floating point (float or double)  (standard IEEE floating point)
  399.      A - ascii (text is case sensitive   - "B" is not the same as "b" ).
  400.      T - text  (text is case insensitive - "B" is     the same as "b" )
  401.      C - single character (equivilent to type A with length 1 )
  402.  
  403.   Type I should be prefixed by "U" if the integer is unsigned.  Do NOT insert
  404. any space between the U and the I.
  405.      
  406. Keys that are record fields of type:      should be designated as:
  407.     WORD   SHORT   LONG      int                   I
  408.    UWORD  USHORT  ULONG  unsigned int             UI
  409.     float double                                   F
  410.     char                                           C or A
  411.     char[<N>] BYTE[<N>] UBYTE[<N>]                 T or A 
  412.  
  413. Keys that are record fields of type:      may be designated:    or: or: or:    
  414.     BYTE                                           I             C   A   T
  415.    UBYTE                                          UI             C   A   T 
  416. depending on how they are to be used.
  417.  
  418. NOTE: any T or A key is considered to consist of individual UNsigned bytes
  419. (UBYTE).
  420.  
  421.  
  422. Ascending/Descending
  423. --------------------
  424.   There are two possible specification characters:
  425.      A - ascending
  426.      D - descending
  427.  
  428. Unique/Repeatable
  429. -----------------
  430.   There are two possible specification characters:
  431.      U - unique
  432.      R - repeatable
  433.  
  434.   Example:  If date is a key to a Bank Account Transaction File, it would need
  435.             to be repeatable, as otherwise there could be only one transaction
  436.             per day.
  437.             The account number in the Bank Account File, however, would have
  438.             to be a unique key, or several accounts could have the same
  439.             account number.
  440.  
  441.  
  442. Example Specs File (don't include the dashed lines in your specs files):
  443.  
  444. ----------------------------------------------------------------
  445. FINANCES:checks.data
  446. FINANCES:checks.index
  447. 126
  448. 0 8 T A R
  449.           0 10 T A U
  450. 34      4                           UI D                      R
  451. ----------------------------------------------------------------
  452. The data file is checks.data, and is on a disk (or logical device) named
  453. FINANCES.
  454.  
  455. The index file is checks.index, and is on the same disk/device as the data
  456. file.
  457.  
  458. The record length is 126 bytes.
  459.  
  460. Key #0 starts at record offset 0, is 8 bytes long, type T, is ascending,
  461. and key values may repeat.
  462.  
  463. Key #1 also starts at record offset 0, is of length 10, also is type T,
  464. also is ascending, but is unique.
  465.  
  466. Key #2 starts at record offset 34, is of length 4, is of unsigned integer
  467. type, is descending, and its key values may repeat.
  468.  
  469.  
  470. In the above example, the first key line should be your model.  The second
  471. and third key lines are included to show that the spacing may vary.
  472. The second key line doesn't start at the first character position of the line
  473. (fine) and the third key line has multiple and varied spacing (great).  Note,
  474. however that, as stated above, the U (unsigned) qualifier for the I (integer)
  475. type CANNOT be separated from the type by any spaces.
  476. Note that keys number 0 and 1 (the first and second key lines) overlap.
  477.  
  478.  
  479.  
  480. PAD BYTES:  (Note well!)
  481. ----------
  482. (ARexx users may probably skip this section, unless the records they use are
  483. also used from C programs, where it most definitely applies.  Users of other
  484. languages will have to check their references to see if it applies or not.)
  485.  
  486. If a key spans several fields in a record, there may be PAD BYTES in the
  487. record between one or more of the fields (due to data alignment, as 
  488. described above).
  489. The presence of pad bytes may be determined by finding the offset of each
  490. field included in the key (using offsetof(), as shown above), and comparing
  491. each with the offset/length of the previous field.
  492.   If there are pad bytes in the key, be sure to include them when specifying
  493. the key length.
  494.   It is possible that, by rearranging the order of the fields in the record,
  495. that pad bytes may be eliminated.  This will also reduce the size of the
  496. record, which is always a good idea.
  497. For example, the struct below, which has pad bytes where indicated, could
  498. be rearranged as shown on the right:
  499.  
  500.          struct Employee {             struct Employee{
  501.             char  Name [31];              char  Name [31];
  502.                        <-----pad byte     char  SSN [9];
  503.             float Salary;                 char  Phone [7];
  504.             char  SSN [9];                char  NickName[11];
  505.                        <-----pad byte     float Salary;
  506.             int   Age;                    int   Age;
  507.             char  Phone[7];               WORD  DaysLate; 
  508.                        <-----pad byte  }
  509.             WORD  DaysLate;
  510.             char  NickName[11];
  511.          }
  512. The pad bytes could also be eliminated by adding or subtracting 1 to the 
  513. length of each character array (making each an even number of bytes long).
  514.  
  515.   If re-arrangement is not possible, then along with specifying a longer
  516. key size, the following must also be done:
  517.  
  518.     Each pad byte must be EXPLICITLY SET to a specific value (zero, probably)
  519.     each time the key value is set or changed in the record, as otherwise
  520.     is is uncertain just WHAT value will be stored there, and if that value
  521.     varies from record to record, it will wreck the ordering.
  522.  
  523. Ex.  An ascending key composed of the following fields of a record:
  524.                ...
  525.                char[5] firstname;
  526.                int     age;
  527.                char[4] lastname;
  528.                ...
  529.      would have a pad byte between the first two fields listed.
  530.      If two key values have the same first two fields, and a differing
  531.      third, their values could look like this:
  532.  
  533.                char[5]       int  char[4]
  534.                -------       ---  -------
  535.                "Henry"  24   27   "Ford"
  536.                "Henry"   9   27   "Fork"
  537.  
  538.      Ignoring the pad byte, one would expect the first
  539.      key value to be ordered BEFORE the second ("Henry/27/Ford" coming
  540.      before "Henry/27/Fork"), but because of the pad byte values,
  541.      it will actually be stored AFTER it ("24" coming after "9").
  542.  
  543.      If the struct were changed to:
  544.                ...
  545.                char[5] firstname;
  546.                byte    pad;
  547.                int     age;
  548.                char[4] lastname;
  549.                ...
  550.      and 'pad' set to zero each time, the ordering would then be as
  551.      expected.
  552.  
  553.  
  554.  
  555. Once a specs file is created, the corresponding ISAM file (data and index
  556. files) can then be created.  An ISAM file MUST be created before it can be
  557. used.  Once the record structure has been decided upon, keys selected, and
  558. specs file edited and saved, invoke the command "CreateISAMFile", with the
  559. specs file as the only parameter (see ISAM.AutoDocs for details).
  560.  
  561.  
  562. For an example run-through of the process of creating a record, deciding
  563. what to use as keys, and how to specify the keys in the specs file, see
  564. the last section of the ARexx/ISAM documentation file.
  565.  
  566.  
  567.  
  568.                          RUNNING THE ISAM SERVER
  569.                          -----------------------
  570.  
  571.   First of all, make a backup copy of the ISAM distribution disk (or the disk
  572. onto which you copied the shareware file(s), and work with that, putting the
  573. original disk away in a safe place.
  574. NEVER use the original disk of ANY software you purchase as your working
  575. copy!
  576.  
  577.   Since ISAM is a server for the entire computer, it is run only once during
  578. each time the computer has been booted, unless it is intentionally removed.
  579. As the program occupies little memory, it will probably not need to be
  580. removed for that reason.
  581. Also, since it is designed to be run only once, storing it in RAM: prior to
  582. use, or trying to make it resident would only waste memory. 
  583.  
  584.  
  585. FROM THE CLI / SHELL:
  586. ---------------------
  587.  
  588.   The server is the file named simply "ISAM".
  589.   From any directory, type: "<path>ISAM" (where <path> is wherever you've got
  590. the server stored - even from a copy of the original floppy disk).
  591. If you put it in the sys:c directory, or if the directory where you have
  592. stored it has been added to the search path (with the AmigaDOS "Path" command),
  593. then specifying a path is unnecessary.
  594. It is also unnecessary if you have changed directories (AmigaDOS "CD" command)
  595. to the directory containing the ISAM file(s).
  596.  
  597. Ex.  "ISAM"
  598.      "work:servers/ISAM"
  599.      "COMMANDS:ISAM"  where COMMANDS: is an assigned logical device (see
  600.                       the AmigaDOS "Assign" command).
  601.      "df0:ISAM"       where the backup copy of the original disk is in df0:.
  602.  
  603.  It has been designed to run in the background, so prefacing the command
  604. with "run " is unnecessary.
  605. A large requester will appear describing ISAM, and unless there's a problem,
  606. "ISAM Installed." will appear in the message area.  The single button
  607. centered below the message area will contain the word "Continue", unless
  608. there's a problem, when the word "Abort" will appear instead.  Press the
  609. button.  That's all there is to it.
  610. The CLI/Shell prompt will re-appear (you may need to press <return>, though),
  611. and other commands may then be entered.
  612. (The requester will reappear when the server is being shut down, with the
  613. phrase "ISAM Shutting Down." in the message area.)
  614.  
  615.   If you wish to eliminate the requester that appears when ISAM is being
  616. installed or shut down, simply add a parameter to the "ISAM" command.  The 
  617. composition of this parameter is ignored.  The requester will STILL appear
  618. if an error occurs when installing ISAM.
  619.  
  620.   If the default stack of 4K (4096) should prove insufficient, see "FROM
  621. THE WORKBENCH" below for directions on how to increase it (it CANNOT be
  622. changed from the CLI/Shell).  The stack size, and the largest stack amount
  623. used so far are some of the things output from the ISAM Status Report
  624. command/function (see ISAM.AutoDocs).
  625.  
  626. To remove ISAM, type: "<path>ISAMShutDown", where, as above, <path> is 
  627. wherever the program is stored.   A small requester will appear, giving
  628. you a chance to abort the shutdown.  Click on "NO" to abort, "YES" to
  629. shut down ISAM.  To eliminate the "Are you sure..." requester, add a
  630. parameter to the above command (the composition of the parameter is ignored).
  631.  
  632.  
  633. FROM THE WORKBENCH
  634. ------------------
  635.  
  636.  Open whatever drawer in which you have the ISAM server stored (or the
  637. disk icon of a copy of the original disk).  Several icons will appear.
  638. Open the "ISAM" icon.  The same requester described in "FROM THE CLI" will
  639. appear, and the same action is required.
  640.  
  641. To remove ISAM, open the ISAM icon that has "ISAM" with a "no smoking"-type
  642. slash across it.  The same requesters described in "FROM THE CLI" will
  643. appear, and the same actions are required.
  644.  
  645. To change the stack size, it is necessary to first select the ISAM icon, and
  646. then choose the "Information" Workbench menu item.  This must be done before
  647. installing ISAM in memory.
  648.  
  649. If you wish to eliminate the requester that appears when ISAM is being
  650. installed or shut down, add "QUIET" to the tooltypes box (click on "New",
  651. type the word "QUIET", press <return>, and click on "Save"). The requester
  652. will STILL appear if an error occurs when installing ISAM.
  653.  
  654. To change the stack size, find the box next to the word "Stack", change it
  655. to the desired size, press return, and then click on the "Save" gadget.
  656. If you find (through using the ReportISAMStatus command/function) that the
  657. stack used figure is close to the stack size, then you know that you need
  658. to increase the stack size.
  659. Setting it too low can cause the machine to crash, either immediately upon
  660. installation, or later during a complicated operation.  This is true of
  661. any program, not just ISAM.
  662.  
  663.  
  664.  
  665.  
  666.                           USING THE ISAM FUNCTIONS
  667.                           ------------------------
  668.  
  669. In general, the programmer need only:
  670.  
  671.     1.* #include the prototype header file for the ISAM functions (this 
  672.         also pulls in the error #define file for the error names, and the
  673.         file of function #pragmas);
  674.     2.  Copy the Resident Library ("isam.library") to the system LIBS:
  675.         directory; ARexx users need to do the same with the
  676.         "rexxisam.library" file.
  677.     3.  Open the ISAM Resident Library prior to using any ISAM functions;
  678.         ARexx users: follow the instructions in RexxISAM.doc.
  679.     4.  use whatever ISAM functions are necessary in the program;
  680.     5.  Close the ISAM library when finished using the ISAM functions.
  681.         ARexx users: follow the instructions in RexxISAM.doc.
  682.  
  683. Any C dialect that cannot handle prototypes with variable names should use the
  684. prototype file ending in "nn.c" (NoNames).  If it cannot handle prototypes at
  685. all, just use the error-define file, and add to it the #defines for OK and
  686. ALLFILES from the prototype file.
  687.  
  688. If your language cannot handle #pragma statements, or cannot handle #pragmas
  689. for functions with more than 4 parameters, then comment out the line in the
  690. prototype header file #include'ing the #pragma file, and add the file
  691. "ISAMStub.Lib" to the list of libraries your linker scans.
  692.  
  693. The prototype file uses the Logical Device "MYLIB:" in pulling in #include
  694. files for errors and #pragmas.  Either "Assign" it where you want, or replace
  695. it with your accustomed assign.
  696.  
  697. * Non-C programmers will need to adapt these guidelines, and the instructions
  698. that follow, to the way their language handles defined names, and Resident
  699. Libraries.  Assembler programmers should put the similar .i files wherever
  700. they usually store include files.  ARexx users may ignore #1.
  701.         
  702.  
  703.  
  704.                             FUNCTION COMMENTS
  705.                             -----------------
  706.  
  707. (See ISAM.AutoDocs for a description of the functions and their parameters.)
  708.  
  709.  
  710.     - Most functions return values of type "long".  The value 0L (#define
  711.       name "OK") is returned to indicate a successful completion, and a non-
  712.       zero result for failure.  These non-zero Error Codes are sometimes
  713.       merely Condition Codes.  For example, ReadNextISAMRecord returns
  714.       ERROR_NO_MORE_RECORDS when there are no more records in an iteration,
  715.       a condition expected to occur eventually.
  716.  
  717.       The error codes returned are usually ISAM error codes (see the file
  718.       ISAMErrors.doc, and the function/command ISAMWhy), but not always.
  719.       If the error code returned is not an ISAM error, then it is probably
  720.       a DOS error.  Use the AmigaDOS "fault" command to get a handle on why
  721.       the function failed.  For example:  if you specify the name of a specs
  722.       file to OpenISAMFile, and the file does not exist, you will receive
  723.       the error 205, which is DOS's ERROR_OBJECT_NOT_FOUND.
  724.  
  725.       For most Non-Read functions, the following is a good template to use:
  726.  
  727.         if ( (ErrorCode = <function_name> ( <parm1>, <parm2, ...)) != OK )
  728.           {
  729.             ...error handling code...
  730.           }
  731.  
  732.       For read/store/modify/etc., where there are multiple likely condition
  733.       codes, a switch makes more sense:
  734.  
  735.         ErrorCode = <function_name> ( <parm1>, <parm2, ...);
  736.         switch ( ErrorCode )
  737.         {
  738.           case ERROR_NO_SUCH_RECORD :  ...for ReadUnique...
  739.           case ERROR_DELETED_RECORD :  ...for Modify/Delete/ReadISAMRecord
  740.  
  741.               ...etc...    
  742.  
  743.           case OK : break;
  744.  
  745.           default : ...handle unexpected errors here...
  746.         }
  747.       See FileConvert.c, test.c, and Books.c in the example directory
  748.       for sample code.
  749.  
  750.     - The ISAM Resident Library must be opened prior to any call to an
  751.       ISAM function.  Failure to do this will cause AT LEAST the program
  752.       to crash.
  753.       The Library must be closed prior to your program's termination.
  754.  
  755.       Use the following code fragments (in C):
  756.  
  757.           struct Library *ISAMBase;
  758.          ...
  759.           if ( (ISAMBase = OpenLibrary ( "isam.library", 0 )) == NULL )
  760.             {
  761.               ...handle error - library didn't open - CAN'T CALL FUNCTIONS...
  762.             }
  763.          ...
  764.           CloseLibrary ( ISAMBase );  /* ONLY if the earlier Open succeeded */
  765.  
  766.       NB: "ISAMBase" and "isam.library" are CASE-SENSITIVE, and MUST be
  767.       used as shown.
  768.  
  769.     - OpenISAMFile / CloseISAMFile.  OpenISAMFile must be called prior to
  770.       use of any other ISAM function that needs to access a particular file.
  771.       Open creates certain user-specific file memory structures that Close
  772.       later releases.  If a file being opened is not already in use (by
  773.       another user), other (non-user-specific) memory structures are created,
  774.       and if no other user has this file open when Close is called, those
  775.       structures are released as well.
  776.  
  777.     - Every function that is ISAM-file-specific (that is, operates on one
  778.       specific ISAM file), must supply an ID that distinguishes that file
  779.       from other files.
  780.       This ID is known as an ISAM Handle, and is returned to you as a 
  781.       parameter of OpenISAMFile.  The actual contents of this handle are
  782.       unimportant.  Just create a variable to hold the handle, and provide
  783.       a pointer to it when calling Open.
  784.       The ISAM Handle returned will never be zero (0L).
  785.  
  786.     - Every function that deals with a specific record refers to a record ID
  787.       known as the Record Number.  StoreISAMRecord returns this number in
  788.       a parameter (as does ReadNextISAM(Record|Key)), and the other record-
  789.       specific functions (including ReadISAMRecord) require this number to
  790.       be supplied as a parameter.
  791.       Zero (0L) is a valid record number.
  792.  
  793.     - Records may be read in several ways.  Single records may be read by
  794.       ReadISAMRecord or ReadUniqueISAMRecord.  Groups of records are read by
  795.       first calling one of three functions used to set up an ISAM ITERATION
  796.       (multiple-record retrieval).  This is then followed by repeatedly
  797.       calling the function ReadNextISAMRecord until no more records match
  798.       the desired criteria.
  799.  
  800.     - The "Record" parameter, in all Read functions, points to memory
  801.       belonging to the calling program.  It is NOT a pointer to memory that
  802.       ISAM owns.  The calling program must set aside the memory itself, either
  803.       as a simple variable declaration, or as memory the program has asked
  804.       DOS to allocate for it.  In effect, the program calling Read is saying
  805.       "HERE is where I want ISAM to put the record."
  806.  
  807.     - The function CountISAMRecords will return the number of records that
  808.       meet the criteria defined when an iteration is set up.  The iteration
  809.       remains set up ("SetUp..." does not need to be called again.).
  810.  
  811.     - The function ReadNextISAMKey will return ONLY the KEY VALUE of the
  812.       next record - not the record itself.  This is useful for those cases
  813.       when the key information alone is sufficient, and the rest of the
  814.       record is not currently needed.  Like ReadNextISAMRecord, the KeyValue
  815.       parameter is a pointer to memory belonging to the calling program.
  816.  
  817.     - Setting up an iteration for the same key where one is already set up
  818.       is NOT considered an error.  The old iteration is merely cancelled,
  819.       and the new one set up in its place.
  820.  
  821.     - Several iterations on the same file may be going on at the same time,
  822.       so long as each is iterating on a different key.  
  823.  
  824.     - When an iteration is underway, (in the middle of repeatedly calling
  825.       ReadNext...), do NOT Store/Modify/Delete any records, and do not 
  826.       ReadUnique with the same key that the iteration is using.  This
  827.       will destroy the sequence you have set up.
  828.       Creating/ReIndexing/Deleting/Closing the same file are obviously
  829.       bad ideas if you want to keep the iteration intact.
  830.       Calling GetFirstLastISAMKeyValues is also out.
  831.       Other operations should be safe, including ReadISAMRecord.
  832.  
  833.     - The ISAM Server does the actual opening and closing of the data 
  834.       and index files when a request to Open/CloseISAMFile is made.
  835.       Therefore, Opening an ISAM file does NOT add to any "maximum files
  836.       open" limitation of the program calling ISAM.
  837.  
  838.     - A record is always stored/modified/deleted in the data file BEFORE
  839.       its keys are added/removed to/from the index file.  This is done
  840.       because, there being more operations necessary to store keys, (and thus
  841.       more time needed as well), it is more likely that if a problem occurs,
  842.       it  will happen during the key-storing phase.  Since the record is
  843.       already stored (or deleted), ReIndex'ing the file should be all that
  844.       is necessary to restore things to normal.
  845.  
  846.     - When a program ends, explicitly UnLock'ing locked records, and
  847.       UnLock'ing/Close'ing open files is NOT necessary.
  848.       Any records locked by the program will be UnLock'ed when their file is
  849.       Close'd, and any open files will be UnLock'ed/Close'd when the program
  850.       calls CloseLibrary.  If a program may end without traversing the
  851.       section of code where CloseLibrary is situated, it is suggested that
  852.       an exit trap be set up (if one isn't already) and the CloseLibrary
  853.       call inserted there.
  854.       
  855.     - When ISAM is shut down, all Open files will be UnLock'ed and Close'd
  856.       (so if any program bombs without calling CloseLibrary, all will be
  857.       taken care of when ISAM shuts down). 
  858.       Any user functions still waiting in line to be served will return with
  859.       ERROR_ISAM_SHUTTING_DOWN.
  860.  
  861.     - CountISAMRecords, DeleteISAMRecords, and ReIndexISAMFile, unlike most
  862.       other ISAM functions, do not return "instantaneously."  
  863.       It is therefore STRONGLY recommended that they be forbidden where there
  864.       are simultaneous users, as all other users will appear to "hang" while
  865.       the function executes.  Count... may be rendered safer by using 
  866.       CountMax, but even for a reasonably small file, some delay is
  867.       inevitable.
  868.  
  869.     - ReIndexISAMFile CANNOT be used to effect a change of record size or
  870.       structure (fields moved, added, or removed).  To do that, a new ISAM
  871.       file must be Created with the new specifications (make SURE the data
  872.       and index file names are DIFFERENT in the new specs file!).  Then, a
  873.       file conversion program must be written to transfer the old ISAM file's
  874.       records to the new file.  This can be easily done by the following
  875.       technique:
  876.         Open the old ISAM file and the new ISAM file;
  877.         ReadISAMRecord the old file's records sequentially; copy
  878.         the old record information to the new record, make any
  879.         changes needed to the new record, and StoreISAMRecord the
  880.         new record to the new file; Close both ISAM files;  Once ASSURED of
  881.         a successful conversion, the old file may be Deleted.
  882.  
  883.       FileConvert.c is a template file showing in more detail how
  884.       the above technique may be done.
  885.  
  886.  
  887.  
  888.  
  889.                                ISAM COMMANDS
  890.                                -------------
  891.  
  892. The following commands, except where noted, require the SpecsFileName to be
  893. entered on the command line, just as a string containing the SpecsFileName
  894. is required as a parameter for the function.
  895. Except where noted, where FUNCTIONS of the same name exist, the commands
  896. accomplish the same thing, and require the same input.
  897.  
  898. The commands may be found in the "c" directory of the distribution disk/file.
  899.  
  900. If using a version of AmigaDOS prior to 2.0x, the commands MUST be entered
  901. from the CLI/Shell.  If 2.0x (or later) is used, the commands may also be
  902. run from the Workbench:  when you Open the tool icon bearing the name of
  903. the desired command, a window will open allowing you to enter the command
  904. and parameters just as if you were entering them from a CLI/Shell.  Anything
  905. that would ordinarily be printed in the CLI/Shell, will be re-directed to
  906. an "Output Window."  If there is a lot of information to print, it may scroll
  907. off the window.  If that is the case, it is recommended that the output be
  908. redirected to a file (or printer), so that the file may be later viewed in
  909. its entirety with a text editor or wordprocessor.
  910. (To be able to view the tool icons of the c directory with Workbench 2.0x
  911. (or higher), the menu option "View By: Icon"/"Show: All Files" must be 
  912. selected for the open "c" directory (drawer).)
  913.  
  914. These commands are not "sacred."  Except for ISAMFileReport, they merely
  915. call the associated ISAM function from the library, perhaps after doing some
  916. preliminary setup, and print messages regarding the status of the function
  917. return.  If you don't like one or more of the commands, just write your own
  918. (even using ARexx, with version 1.03), replacing the commands provided.
  919. Add your own (new) commands, as well...  A command could be written that 
  920. would prompt the user for information needed for the Specs File, and would
  921. then create the Specs File from that information.
  922.  
  923.  
  924.  DeleteISAMFile -
  925.  
  926.  
  927.  CreateISAMFile -
  928.  
  929.  
  930.  ReIndexISAMFile
  931.                 - The presence or absence of a second parameter (one
  932.                 following the SpecsFileName) determines whether a Counter
  933.                 window will be displayed or not.  The actual composition
  934.                 of this second parameter is ignored.
  935.                 
  936.  ISAMFileReport - 
  937.                 This program looks at the Specs and Index file and reports
  938.                 on the  vital statistics of the ISAM file in question: names
  939.                 of data and index files, the record size, record count
  940.                 keycount, and the key offset/size/type/etc. for each key.
  941.                 It also reports on whether there are currently deleted
  942.                 records in the file.
  943.                 This command does not require ISAM to be installed to work.
  944.  
  945.  
  946.  ISAMWhy        - ALL | ErrNo [,ErrNo [,ErrNo [,ErrNo...]]]
  947.  
  948.                 If 'ALL' is entered on the command line, a list of all ISAM
  949.                 error numbers, along with #define strings, is typed to
  950.                 the console.  Re-direct this command to a file or printer
  951.                 for a permanent list.
  952.                 The command also accepts multiple error numbers on the
  953.                 command line, printing a descriptive line for each.
  954.                 This command does not require ISAM to be installed to work.
  955.  
  956.  
  957.  SeqToISAM      - <Sequential File Name> <record size>
  958.                 a record-sequential file (a file in which fixed-size records
  959.                 are stored one after the other, with nothing in between) 
  960.                 is modified to the ISAM data file format (a single byte is
  961.                 added prior to each record).
  962.                 Any record whose first four bytes are "FREE" will be marked
  963.                 as deleted. (ISAM will later reclaim their space as records 
  964.                 are subsequently Store'd).
  965.                 The modified file will be stored under the given name with
  966.                 ".NEWFILE" appended.  The record-sequential file will be left 
  967.                 unchanged.
  968.                 This command does not require ISAM to be installed to work.
  969.  
  970.  
  971.  ISAMPresent    - <suppress message>
  972.                 This program is designed to be used in a script file.
  973.                 Since ISAM is a background process (and would be unlikly
  974.                 to be shut down in any case), it does not have a return code.
  975.                 However, it is still necessary to know if ISAM is "out there"
  976.                 in order to run programs that require its presence.
  977.  
  978.                 Therefore, the program ISAMPresent may be used to determine
  979.                 ISAM's presence/absence.
  980.  
  981.                 The message: "ISAM is present" (or "not present") will be
  982.                 printed.  Return Code '5' will be returned if it couldn't
  983.                 find ISAM, and return code '0' if it does.
  984.  
  985.                 Ex:  ISAMPresent q
  986.                      if WARN
  987.                        echo "Uh-oh!  ISAM is not installed."
  988.                        quit
  989.                      else
  990.                        prog1
  991.                        prog2
  992.                        ...
  993.                      endif
  994.                 The message will be suppressed if there is a parameter
  995.                 present on the command line.  The actual composition of the
  996.                 parameter is ignored.
  997.                 This command does not require ISAM to be installed to work.
  998.                 Obviously.
  999.  
  1000.  
  1001.  ReportISAMStatus
  1002.                 - 
  1003.  
  1004.  
  1005.  
  1006.  
  1007.                         NOTES ON FILE/RECORD LOCKING
  1008.                         ----------------------------
  1009.  
  1010.   ISAM files and individual records may be locked to limit or deny access to
  1011. other users; a file may be locked at the time it is opened, and a record at
  1012. the time it is read or stored, and either may be done at any other time as
  1013. well.
  1014. Locks come in two "flavors": exclusive and shared.  If a file is locked with
  1015. an exclusive lock, neither it nor any of its records may be read, changed,
  1016. or locked by another user.  Likewise, an individual record locked with an
  1017. exclusive lock may not be accessed by another user.
  1018. A file that is locked with a shared lock may be read by another user, but not
  1019. changed or locked.   Records that are locked with a shared lock (and records
  1020. in a file that is shared locked) likewise may only be read, not changed.
  1021. For our purposes, "change" includes attempting to modify or delete an exist-
  1022. ing record, or store a new one.
  1023.  
  1024.  
  1025. DEADLOCK
  1026. --------
  1027.  
  1028. Since files and records may be locked, the situation may occur that two differ-
  1029. ent users having different files/records locked may each request something
  1030. that the other has locked.  If each keeps trying until it gets what it wants,
  1031. they will each wait forever.  This is known as deadlock.  There are three
  1032. strategies that will help avoid deadlock.
  1033. First, instead of continuously looping until the request is (or in this case, 
  1034. isn't) granted, back off.  Inform the user that the record/file desired is
  1035. locked and to please try again later.  The user then may wait, do something
  1036. else, end the program, etc.  He isn't dead in the water.  Secondly, if several
  1037. programs each use two or more of the same ISAM files, make sure that they all
  1038. attempt to open them in the same order: A then B then C.  This way it is im-
  1039. possible to deadlock:  Program 1 opens/locks A and B; Program 2 then tries to 
  1040. get A and fails.  True, he is locked out of A, BUT he doesn't have anything
  1041. locked himself - so deadlock cannot occur.  Even if he has a try-until-succeed
  1042. loop, it's not deadly.  Program 1 will eventually quit and he will then succeed.
  1043. Thirdly, any time you get a lock error, unlock EVERYTHING you've got locked
  1044. and begin over.  This avoids deadlock, but is often difficult (not to mention 
  1045. time-consuming) to code.
  1046. Strategy 2 is often not practical for Record locking (different programs may
  1047. use different keys to get at the same records - hence different orders).
  1048. Remedy 1 or 3 would then be better bets for record-locking.
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                                 EXAMPLES
  1054.                                 --------
  1055. TEST
  1056. ----
  1057.  
  1058. The file "test", in the examples subdirectory, is a test program showing
  1059. the use of most of the ISAM functions in manipulating the ISAM file 
  1060. "Employee".  (Employee is found in the data subdirectory).
  1061. Test may be run from the Workbench only with AmigaDos 2.0x or higher
  1062. ("show all files" and open the tool icon "test".  You'll need to enlarge
  1063. the Output Window).  Otherwise the CLI/shell must be used.  There
  1064. are no parameters.
  1065.  
  1066. The source code for test (test.c) is included for C-language programmers, 
  1067. to show sample function calls and error/condition code handling.
  1068. Feel free to change it and/or snip bits of it for your own use.
  1069. Non-C-programmers should find it useful as well, although obviously any
  1070. code appropriated will need to be modified to fit the constraints of their
  1071. language.
  1072.  
  1073. Prior to running test, the Logical Device "DATA:" will need to be assigned
  1074. to wherever the specs/data/index files for Employee have been stored.
  1075.  
  1076. The locking/unlocking features can only be tested if test is run from more
  1077. than one CLI/shell simultaneously (since obviously the user locking the file/
  1078. records may access the files/records he/she locked).
  1079.  
  1080.  
  1081. BOOKS
  1082. -----
  1083.  
  1084. The file "Books", in the examples subdirectory, is a working application that
  1085. allows the user to keep an inventory of his books, and to list those books
  1086. in many different orders (8 actually; applications would not ordinarily have
  1087. 8 keys on the same file, but Books does!).  
  1088. Books operates on the ISAM file "Books", located in the data subdirectory.
  1089.  
  1090. Like test, Books needs to have the logical device "DATA:" assigned.
  1091.  
  1092. The source code for Books is included as well, and may be appropriated for
  1093. your own use, just like "test".
  1094.  
  1095.  
  1096.  
  1097.  
  1098. -------------------------------------------------------------------------
  1099.  
  1100. Amiga is a registered trademark of Commodore-Amiga, Incorporated.
  1101. AmigaDOS is a trademark of Commodore-Amiga, Incorporated.
  1102. Commodore is a trademark of Commodore Electronics Limited.
  1103. ARexx is a trademark of Wishful Thinking Development Corp.
  1104. Lattice is a registered trademark of Lattice, Inc.
  1105. SAS/C is a registered trademark of SAS Institute Inc.
  1106.